{% set comma = joiner(",") -%}
{
  "id": 8615018713449143,
  "title": "IP SLA Monitor",
  "tags": [],
  "style": "dark",
  "timezone": "browser",
  "editable": true,
  "sharedCrosshair": false,
  "hideControls": false,
  "time": {
    "from": "now-12h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5m",
      "10m",
      "15m"
    ],
    "time_options": [
      "1h",
      "3h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d"
    ]
  },
  "templating": {
    "list": [
      {% include "template_device.j2" with context -%},
      {% include "template_device_id.j2" with context -%},
      {% include "template_ip_info.j2" with context -%},
      {% include "template_segment.j2" with context -%},
      {% include "template_bi_id.j2" with context -%},
      {% include "template_probe.j2" with context -%}
    ]
  },
  "annotations": {
    "list": [
      {
        "datasource": "NocDS",
        "enable": false,
        "iconColor": "rgba(255, 96, 96, 1)",
        "name": "Alarm",
        "query": "{{device_id}}"
      }
    ]
  },
  "schemaVersion": 13,
  "version": 11,
  "links": [],
  "gnetId": null,
  "rows": [
    {
      "title": "All",
      "showTitle": true,
      "titleSize": "h6",
      "height": "250px",
      "repeat": null,
      "repeatRowId": null,
      "repeatIteration": null,
      "collapse": false,
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "datasource": null,
          "editable": true,
          "error": false,
          "fill": 1,
          "grid": {},
          "id": 9,
          "legend": {
            "alignAsTable": true,
            "avg": true,
            "current": true,
            "max": true,
            "min": true,
            "show": true,
            "total": false,
            "values": true
          },
          "lines": true,
          "linewidth": 2,
          "links": [],
          "nullPointMode": "connected",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 12,
          "stack": false,
          "steppedLine": true,
          "targets": [
            {
              "refId": "A",
              "resultFormat": "time_series",
              "intervalFactor": 1,
              "query": "SELECT \n    t, \n    groupArray((concat('Probe rtt ',path[1]), d)) AS groupArr\nFROM \n    ( SELECT \n        $timeSeries t, \n        path, \n        avg(icmp_rtt) d \n        from noc.sla \n        WHERE \n            $timeFilter\n            AND  managed_object= $bi_id \n        GROUP BY t, path\n        ORDER BY t\n    ) \nGROUP BY t \nORDER BY t",
              "database": "noc",
              "tableLoading": false,
              "table": "sla",
              "dateLoading": false,
              "datetimeLoading": false,
              "dateColDataType": "date",
              "dateTimeColDataType": "ts"
            },
            {
              "refId": "B",
              "resultFormat": "time_series",
              "intervalFactor": 1,
              "query": "SELECT \n    t, \n    groupArray((concat('Probe jitter ',path[1]), d)) AS groupArr\nFROM \n    ( SELECT \n        $timeSeries t, \n        path, \n        avg(jitter) d \n        from noc.sla \n        WHERE \n            $timeFilter\n            AND  managed_object= $bi_id \n        GROUP BY t, path\n        ORDER BY t\n    ) \nGROUP BY t \nORDER BY t",
              "database": "noc",
              "tableLoading": false,
              "table": "sla",
              "dateLoading": false,
              "datetimeLoading": false,
              "dateColDataType": "date",
              "dateTimeColDataType": "ts"
            }

        ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "$device",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "cumulative"
          },
          "type": "graph",
          "xaxis": {
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "ms",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ]
        }
      ]
    },
    {
      "title": "Probe $probe",
      "panels": [
        {
          "aliasColors": {},
          "bars": false,
          "datasource": null,
          "editable": true,
          "error": false,
          "fill": 1,
          "id": 10,
          "legend": {
            "avg": false,
            "current": false,
            "max": false,
            "min": false,
            "show": true,
            "total": false,
            "values": false
          },
          "lines": true,
          "linewidth": 1,
          "links": [],
          "nullPointMode": "connected",
          "percentage": false,
          "pointradius": 5,
          "points": false,
          "renderer": "flot",
          "seriesOverrides": [],
          "span": 9,
          "stack": false,
          "steppedLine": false,
          "targets": [
            {
              "database": "noc",
              "dateColDataType": "date",
              "dateLoading": false,
              "dateTimeColDataType": "ts",
              "datetimeLoading": false,
              "intervalFactor": 1,
              "query": "SELECT \n    $timeSeries as t, \n    avg(icmp_rtt), \n    avg(jitter) \nFROM $table \nWHERE \n    managed_object=$bi_id \n    and $timeFilter \n    and path[1]=toString($probe)\nGROUP BY t \nORDER BY t",
              "refId": "A",
              "resultFormat": "time_series",
              "table": "sla",
              "tableLoading": false
            }
          ],
          "thresholds": [],
          "timeFrom": null,
          "timeShift": null,
          "title": "$device $probe",
          "tooltip": {
            "msResolution": false,
            "shared": true,
            "sort": 0,
            "value_type": "individual"
          },
          "type": "graph",
          "xaxis": {
            "mode": "time",
            "name": null,
            "show": true,
            "values": []
          },
          "yaxes": [
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            },
            {
              "format": "short",
              "label": null,
              "logBase": 1,
              "max": null,
              "min": null,
              "show": true
            }
          ],
          "scopedVars": {
            "probe": {
              "selected": false,
              "text": "530",
              "value": "530"
            }
          }
        },
        {
          "content": "Карточка объекта: [$device](/api/card/view/managedobject/$device_id/).\n\nКарта: [$device](/#inv.map/$segment)\n\nДоступ на объект: [Telnet](telnet://$ip), [ssh](ssh://$ip)\n\nДоступ на цель: [Telnet](telnet://$probe), [ssh](ssh://$probe)",
          "editable": true,
          "error": false,
          "id": 11,
          "links": [],
          "mode": "markdown",
          "span": 3,
          "title": "$device to $probe",
          "type": "text",
          "scopedVars": {
            "probe": {
              "selected": false,
              "text": "530",
              "value": "530"
            }
          }
        }
      ],
      "showTitle": true,
      "titleSize": "h6",
      "height": 250,
      "repeat": "probe",
      "repeatRowId": null,
      "repeatIteration": null,
      "collapse": false
    }
  ]
}